<?php
// 事件定义文件
use app\event\ChangePageSettingSuccess;

return [
    'bind' => [
    ],

    'listen' => [
        'AppInit' => [],
        'HttpRun' => [
//            \app\event\app\AppRequestListener::class
        ],
        'HttpEnd' => [],
        'LogLevel' => [],
        'LogWrite' => [],

        /**
         * 手机话费 CPS 业务
         * =========================start===========================
         */
        \app\event\mobile\MobilePaySuccess::class =>[
            \app\listener\mobile\ZhongAnMobilePaySuccessListener::class, //众安保险支付成功订单推送
        ],
        \app\event\mobile\MobileSupplierSuccess::class =>[ //话费充值成功
            \app\listener\mobile\ZhongAnMobileSupplierSuccess::class,// 众安保险充值成功
        ],
        \app\event\mobile\MobileSupplierFail::class =>[
            \app\listener\mobile\ZhongAnMobileFail::class,//众安保险话费充值失败
        ],
        /**
         * 手机话费 CPS 业务
         * =========================end==============================
         */





        //权益支付完之后的状态
        \app\event\PaySuccess::class => [
            \app\listener\pay\PaySuccessByPaylog::class,  //支付成功根据notify
            \app\listener\pay\SupplierSubmit::class,  //提交供应商和修改状态   butt
            \app\listener\pay\PaySuccessAddSupplierOrderNum::class,  //增加供应商订单数量
            \app\listener\pay\AroundCreateOrder::class,  // 支付成功后 周边游-聚推客产品下单



        ],



        // 供应商下单
        \app\event\SupplierCreateOrder::class => [
            \app\listener\couponOrder\CouponOrderCreate::class, // 创建订单

        ],

        //供应商回调成功
        \app\event\SupplierNotifySuccess::class =>[
            \app\listener\notify\CouponButtSuccess::class,
            \app\listener\notify\CouponOrderUnionSuccess::class, // 成功更改状态
            \app\listener\notify\CouponOrderSuccessSmsNotice::class,//成功发送短信
        ],

        //权益供应商回调失败
        \app\event\SupplierNotifyFail::class =>[
            \app\listener\notify\CouponButtFail::class,
            \app\listener\notify\CouponProductChannelFail::class,
            \app\listener\notify\CouponOrderUnionFail::class, // 失败
            \app\listener\notify\CouponOrderUnionRefund::class, // 退款
            \app\listener\notify\OrderFailSmsNotice::class, //发送短息
        ],

        //影票供应商回调成功
        \app\event\MovieNotifySuccess::class =>[
            \app\listener\notify\MovieOrderButtSuccess::class,
        ],


        //统一订单更新操作
//        \app\event\CouponOrderUpdate::class => [
//            \app\listener\order\OrderDayStatListener::class
//        ],


        //旧代理初始化数据
        \app\event\OldAgent::class =>[
            //初始化权益
            \app\listener\agent\Coupon::class,
            //初始化本地生活
            \app\listener\agent\LocalLife::class,
            //初始化外卖系统
            \app\listener\agent\Takeout::class,
        ],

        //新增代理初始化
        \app\event\AgentAddSuccess::class =>[
            //初始化权益
            \app\listener\agent\AgentAddSuccessCouponButt::class,
            //初始化外卖系统
            \app\listener\agent\AgentAddSuccessTakeoutButt::class,
            //初始化本地生活
            \app\listener\agent\AgentAddSuccessLocalLifeButt::class,
            //新增代理商时，全局溢价默认为4%(可配置)
            \app\listener\agent\AgentAddSuccessPremiumRate::class,
            //新增代理商时，如果是关联有美生活，则新增小程序渠道
            \app\listener\agent\AgentAddSuccessYmsh::class,
        ],

        //模板编辑
        \app\event\TemplateEditSuccess::class =>[
            //初始化权益
            \app\listener\template\TemplateEditSuccess::class,
        ],

        //页面配置修改
        \app\event\ChangePageSettingSuccess::class =>[
            //初始化权益
            \app\listener\agent\ResetCache::class,
        ],

        //H5权益首页清除缓存
        \app\event\ClearCouponH5CacheSuccess::class =>[
            //清除缓存
            \app\listener\cache\ClearCouponH5Cache::class,
        ],
    ],

    'subscribe' => [

    ],
];
